import request from '@/utils/request'
/**
 * 一杆一档&关键设备作业数据列表查询
 * @param {string} devClassCode
 * @param {string} pillarCode || deviceCode
 */
export function getWorkData(query) {
  return request({
    url: '/repair/jcwRepairJob/findPageByQuery',
    method: 'get',
    params: query
  })
}
export function getWorkDataNew(query) {
  return request({
    url: '/repair/jcwRepairJob/findWxJobPageByQuery',
    method: 'get',
    params: query
  })
}
/**
 * 锚段作业数据列表查询
 * @param {string} anchorCode
 */
export function getAnWorkData(query) {
  return request({
    url: '/repair/jcwRepairJob/findJobPageByAnCode',
    method: 'get',
    params: query
  })
}
/**
 * 一杆一档&关键设备通用台账列表查询
 * @param {string} repairJobId 检修作业ID
 * @param {string} pillarId || deviceId
 * @param {string} recordTypeId 台账类型
 */
export function getReportPage(query) {
  return request({
    url: '/repair/repairRecord/findPageRepRecByQuery',
    method: 'get',
    params: query
  })
}
/**
 * 锚段通用台账列表查询
 * @param {string} repairJobId 检修作业ID
 * @param {string} anchorCode
 * @param {string} devClassCode
 */
export function getReportPageByAnchor(query) {
  return request({
    url: '/repair/repairRecord/findPageRepRecByAnchorCode',
    method: 'get',
    params: query
  })
}
/**
 * 一杆一档&关键设备检修台账类型查询
 * @param {string} pillarCode || deviceCode
 * @param {string} devClassCode
 */
export function getReportType(query) {
  return request({
    url: '/repair/repairRecord/findReportRecordTypes',
    method: 'get',
    params: query
  })
}
export function getReportTypeNew(query) {
  return request({
    url: '/repair/repairRecord/findReportRecordTypesNew',
    method: 'get',
    params: query
  })
}
/**
 * 获取所有台帐类型
 */
export function getAllReportType(query) {
  return request({
    url: '/repair/repairRecord/findAllRecordTypes',
    method: 'get',
    params: query
  })
}

/**
 * 获取所有台帐类型
 */
export function queryReportType(query) {
  return request({
    url: '/repair/repairRecord/findRecordTypesForYearAndDept',
    method: 'get',
    params: query
  })
}

/**
 * 二级页面线路检修情况
 * @param {string} lineId
 */
export function getRepairAmounByLine(query) {
  return request({
    url: '/repair/jcwRepairJob/getRepairAmountBySite',
    method: 'get',
    params: query
  })
}
/**
 * 二级页面车间检修情况
 * @param {string} lineId
 */
export function getRepairAmounByPath(query) {
  return request({
    url: '/repair/jcwRepairJob/getWorkshopMileageByIdPathSite',
    method: 'get',
    params: query
  })
}
/**
 * 二级页面线路检修公里总数
 * @param {string} lineId
 */
export function getRepairAllByLine(query) {
  return request({
    url: '/repair/jcwRepairJob/sumRepairAmountAllByLineId',
    method: 'get',
    params: query
  })
}
/**
 * 二级页面线路已检修公里数
 * @param {string} lineId
 */
export function getRepairedByLine(query) {
  return request({
    url: '/repair/jcwRepairJob/sumRepairOperateKilAllByLineId',
    method: 'get',
    params: query
  })
}

/**
 * 三级页面线路检修公里总数
 * @param {string} lineId
 */
export function getRepairAllBySite(query) {
  return request({
    url: '/repair/jcwRepairJob/sumRepairAmountAllBySiteId',
    method: 'get',
    params: query
  })
}
/**
 * 三级页面线路已检修公里数
 * @param {string} lineId
 */
export function getRepairedBySite(query) {
  return request({
    url: '/repair/jcwRepairJob/sumRepairOperateKilAllBySiteId',
    method: 'get',
    params: query
  })
}
/**
 * 设备看板查询设备下的维修作业信息
 * @param {string} pillarCode
 * @param {string} devClassCode
 * @param {string} year
 */
export function findList(query) {
  return request({
    url: '/repair/jcwRepairJob/findList',
    method: 'get',
    params: query
  })
}
